package lcr;


public class Test0123 {
}

class Solution0123_1 {
    public int[] reverseBookList(ListNode head) {
        int len=0;
        ListNode cur=head;
        while (cur!=null) {
            len++;
            cur=cur.next;
        }

        int[] res=new int[len];
        cur=head;
        for (int i=0;i<len;i++) {
            res[len-1-i]=cur.val;
            cur=cur.next;
        }

        return res;
    }
}